//Reads selected value from dropdown list and performs corresponding action
function xpath() {

    var drpdwn = document.getElementById("Index_number");
    var index = drpdwn.options[drpdwn.selectedIndex].value;
    if (index == -1) {
        printAllTable();
    } else {
        printTable(index);
    }
    
}

//Return HTML code for start of dropdown list and initializes all option
function startDropDown() {
    return "<select id=\"Index_number\" on> <option value=\"-1\" selected=\"selected\">All</option>"
}

//Returns HTML closing tag of dropdown list
function closeDropDown() {
    return "</select>";
}

//Returns HTML code for an option with the the given index and maker
function addOption(index, maker) {
    return "<option value=\"" + index + "\">" + index + ":" + maker + "</option>";
}

//Generates and writes the dropdown list 
function initializeDropDown() {
    var size = getSize();
    var str = startDropDown();

    for (i = 1; i <= size; i++) {    
        str += addOption(i,getDataFromXML(i, 1));
    }

    str += closeDropDown();
    document.getElementById("dropdown").innerHTML = str;
}